#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;

int main(){
    //freopen("in.txt","r",stdin);
    int N1,N2;
    scanf("%d",&N1);
    int first[N1];
    for(int i=0;i<N1;i++){
        scanf("%d",&first[i]);
    }
    scanf("%d",&N2);
    int second[N2];
    for(int i=0;i<N2;i++){
        scanf("%d",&second[i]);
    }
    int fina[N1+N2];
    merge(first,first+N1,second,second+N2,fina);
    printf("%d\n",fina[(N1+N2-1)/2]);

}
